home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / dev / gcc / gcc260_base.lha / gnu / os-include / inline / diskfont.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-19  |  2.7 KB  |  103 lines

  1. #ifndef _INLINE_DISKFONT_H
  2. #define _INLINE_DISKFONT_H
  3.  
  4. #include <sys/cdefs.h>
  5. #include <inline/stubs.h>
  6.  
  7. /* BPTR! */
  8. #include <dos/dos.h>
  9.  
  10. __BEGIN_DECLS
  11.  
  12. #ifndef BASE_EXT_DECL
  13. #define BASE_EXT_DECL 
  14. #define BASE_EXT_DECL0 extern struct Library * DiskfontBase;
  15. #endif
  16. #ifndef BASE_PAR_DECL
  17. #define BASE_PAR_DECL
  18. #define BASE_PAR_DECL0 void
  19. #endif
  20. #ifndef BASE_NAME
  21. #define BASE_NAME DiskfontBase
  22. #endif
  23.  
  24. BASE_EXT_DECL0
  25.  
  26. static __inline LONG 
  27. AvailFonts (BASE_PAR_DECL STRPTR buffer,long bufBytes,long flags)
  28. {
  29.   BASE_EXT_DECL
  30.   register LONG  _res  __asm("d0");
  31.   register struct Library *a6 __asm("a6") = BASE_NAME;
  32.   register STRPTR a0 __asm("a0") = buffer;
  33.   register long d0 __asm("d0") = bufBytes;
  34.   register long d1 __asm("d1") = flags;
  35.   __asm __volatile ("jsr a6@(-0x24)"
  36.   : "=r" (_res)
  37.   : "r" (a6), "r" (a0), "r" (d0), "r" (d1)
  38.   : "a0","a1","d0","d1", "memory");
  39.   return _res;
  40. }
  41. static __inline void 
  42. DisposeFontContents (BASE_PAR_DECL struct FontContentsHeader *fontContentsHeader)
  43. {
  44.   BASE_EXT_DECL
  45.   register struct Library *a6 __asm("a6") = BASE_NAME;
  46.   register struct FontContentsHeader *a1 __asm("a1") = fontContentsHeader;
  47.   __asm __volatile ("jsr a6@(-0x30)"
  48.   : /* no output */
  49.   : "r" (a6), "r" (a1)
  50.   : "a0","a1","d0","d1", "memory");
  51. }
  52. static __inline struct FontContentsHeader *
  53. NewFontContents (BASE_PAR_DECL BPTR fontsLock,STRPTR fontName)
  54. {
  55.   BASE_EXT_DECL
  56.   register struct FontContentsHeader * _res  __asm("d0");
  57.   register struct Library *a6 __asm("a6") = BASE_NAME;
  58.   register BPTR a0 __asm("a0") = fontsLock;
  59.   register STRPTR a1 __asm("a1") = fontName;
  60.   __asm __volatile ("jsr a6@(-0x2a)"
  61.   : "=r" (_res)
  62.   : "r" (a6), "r" (a0), "r" (a1)
  63.   : "a0","a1","d0","d1", "memory");
  64.   return _res;
  65. }
  66. static __inline struct DiskFont *
  67. NewScaledDiskFont (BASE_PAR_DECL struct TextFont *sourceFont,struct TextAttr *destTextAttr)
  68. {
  69.   BASE_EXT_DECL
  70.   register struct DiskFont * _res  __asm("d0");
  71.   register struct Library *a6 __asm("a6") = BASE_NAME;
  72.   register struct TextFont *a0 __asm("a0") = sourceFont;
  73.   register struct TextAttr *a1 __asm("a1") = destTextAttr;
  74.   __asm __volatile ("jsr a6@(-0x36)"
  75.   : "=r" (_res)
  76.   : "r" (a6), "r" (a0), "r" (a1)
  77.   : "a0","a1","d0","d1", "memory");
  78.   return _res;
  79. }
  80. static __inline struct TextFont *
  81. OpenDiskFont (BASE_PAR_DECL struct TextAttr *textAttr)
  82. {
  83.   BASE_EXT_DECL
  84.   register struct TextFont * _res  __asm("d0");
  85.   register struct Library *a6 __asm("a6") = BASE_NAME;
  86.   register struct TextAttr *a0 __asm("a0") = textAttr;
  87.   __asm __volatile ("jsr a6@(-0x1e)"
  88.   : "=r" (_res)
  89.   : "r" (a6), "r" (a0)
  90.   : "a0","a1","d0","d1", "memory");
  91.   return _res;
  92. }
  93.  
  94. #undef BASE_EXT_DECL
  95. #undef BASE_EXT_DECL0
  96. #undef BASE_PAR_DECL
  97. #undef BASE_PAR_DECL0
  98. #undef BASE_NAME
  99.  
  100. __END_DECLS
  101.  
  102. #endif /* _INLINE_DISKFONT_H */
  103.